<?php
namespace Project\Model;

use Zend\InputFilter\Factory as InputFactory;     // <-- Add this import
use Zend\InputFilter\InputFilter;                 // <-- Add this import
use Zend\InputFilter\InputFilterAwareInterface;   // <-- Add this import
use Zend\InputFilter\InputFilterInterface;        // <-- Add this import

class Contact implements InputFilterAwareInterface
{
    public $contact_id;
   
    protected $inputFilter;                       // <-- Add this variable

    public function exchangeArray($data)
    {
        $this->contact_id     = (isset($data['contact_id']))     ? $data['contact_id']     : null;
        
    }

    // Add content to this method:
    public function setInputFilter(InputFilterInterface $inputFilter)
    {
        throw new \Exception("Not used");
    }

    public function getInputFilter()
    {
        if (!$this->inputFilter) {
            $inputFilter = new InputFilter();
            $factory     = new InputFactory();

            $inputFilter->add($factory->createInput(array(
                'name'     => 'contact_id',
                'required' => true,
                
            )));

            $this->inputFilter = $inputFilter;
        }

        return $this->inputFilter;
    }
}